var xtQuartzWinAdd;
var xtQuartzFormAdd;
function addXtQuartz(){
	initXtQuartzFormAdd();
	reGetWidthAndHeight();
	xtQuartzWinAdd = Ext.create('Ext.Window',{
		layout:'fit',
		width:clientWidth*0.8,                    
		height:clientHeight, 
		maximizable:true,
		minimizable:true,
		animateTarget:document.body,
		plain:true,
		modal:true,
		title:'添加信息',
		listeners:{
			minimize:function(win,opts){
				if(!win.collapse()){
					win.collapse();
				}else{
					win.expand();
				}
			}
		},
		items:xtQuartzFormAdd,
		buttons:[{
			text:'保存',
			itemId:'save',
			handler:function(button){
				submitForm(xtQuartzFormAdd,'../xtQuartzController/addXtQuartz',grid,xtQuartzWinAdd,false,true);
			}
		},{
			text:'关闭',
			itemId:'close',
			handler:function(button){
				button.up('window').close();
			}
		}]
	});
	xtQuartzWinAdd.show();
}
function initXtQuartzFormAdd(){
	xtQuartzFormAdd = Ext.create('Ext.FormPanel',{
		xtype:'form',
		waitMsgTarget:true,
		defaultType:'textfield',
		autoScroll:true,
		fieldDefaults:{
			labelWidth:140,
			labelAlign:'right',
			flex:1,
			margin:'2 5 4 5'
		},
		items:[
		{
			fieldLabel:'任务编号',
			xtype:'textfield',
			name:'jobId',
			maxLength:64,
			anchor:'100%'
		},
		{
			fieldLabel:'任务名称',
			xtype:'textfield',
			name:'jobName',
			maxLength:64,
			anchor:'100%'
		},
		{
			fieldLabel:'任务分组',
			xtype:'textfield',
			name:'jobGroup',
			maxLength:64,
			anchor:'100%'
		},
		{
			fieldLabel:'任务状态',
			name:'jobStatus',
			maxLength:10,
			xtype:"combo",
            anchor:'100%',
            store:[["NORMAL","启动"],["PAUSED","暂停"]],
            emptyText:"请选择",
            mode:"local",
            triggerAction:"all",
            editable:false
		},
		{
			fieldLabel:'任务运行时间表达式',
			xtype:'textfield',
			name:'cronExpression',
			maxLength:64,
			anchor:'100%'
		},
		{
			fieldLabel:'任务描述',
			xtype:'textareafield',
			name:'desc',
			maxLength:600,
			anchor:'100%',
			height:150
		},
		{
			fieldLabel:'执行的类方法',
			xtype:'textfield',
			name:'targetMethod',
			maxLength:120,
			anchor:'100%'
		},
		{
			fieldLabel:'执行的类',
			xtype:'textfield',
			name:'targetClass',
			maxLength:500,
			anchor:'100%'
		}
		]
	});
}
